All Questions
5 questions
-1votes
1answer
373views
The pythonic way: replacing interfaces with ducktyping vs inheritence
tldr: I have consumer-like classes that require a number of pieces of information to do their job. It's an "all or nothing" kind of thing: the "producers" providing them with data need to provide all ...
3votes
2answers
1kviews
Is “A programmer-defined type.” a right definition of "class" in Python?
In Think Python 2e "class" is defined as "A programmer-defined type. A class definition creates a new class object." But isn't a built-in type considered a class too? Using Python 3.4.0, the ...
7votes
2answers
10kviews
How many types of polymorphism are there in the Python language?
I just read an article by Luca Cardelli and he explained types of polymorphism which are: The article is named On Understanding Types, Data Abstraction, and Polymorphism. Types of Polymorphism ...
54votes
5answers
40kviews
Are Python mixins an anti-pattern?
I'm fully aware that pylint and other static analysis tools are not all-knowing, and sometimes their advice must be disobeyed. (This applies for various classes of messages, not just conventions.) If ...
4votes
1answer
323views
What is the advantage of determining scopes statically and using them dynamically in case of Python?
Firstly let me clarify that I know C and am learning Python. So my OOPS is kind of bad. I was reading the official tutorial and found this Although scopes are determined statically, they are used ...